/**
 * Runnable匿名内部类来创建线程
 */
public class ThreadDemo5 {
    public static void main(String[] args) {
        //匿名内部类
        Thread thread=new Thread(new Runnable(){
            @Override
            public void run(){
                //业务代码
                Thread t=Thread.currentThread();
                System.out.println("执行线程:"+t.getName());
            }
        });
        //启动线程
        thread.start();
    }
}
